package com.gwq.controller;

import com.gwq.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @Autowired
    BCryptPasswordEncoder bCryptPasswordEncoder;

    @Autowired
    SysUserService sysUserService;

    /*@PreAuthorize("hasRole('admin')")
    @GetMapping("/test")
    public Result test(){

        return Result.succ(200,"操作成功", sysUserService.list());
    }

    @PreAuthorize("hasAnyAuthority('sys:user:list')")
    @GetMapping("/test/pass")
    public Result pass(){
        String password = bCryptPasswordEncoder.encode("111111");
        boolean matches = bCryptPasswordEncoder.matches("111111", password);
        System.out.println("匹配结果" + matches);
        return Result.succ(password);
    }*/
}
